<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>console.interactive.InteractiveShell</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="console-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/console/">console</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="console-module.html">Package&nbsp;console</a> ::
        <a href="console.interactive-module.html">Module&nbsp;interactive</a> ::
        Class&nbsp;InteractiveShell
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="console.interactive.InteractiveShell-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class InteractiveShell</h1><p class="nomargin-top"><span class="codelink"><a href="console.interactive-pysrc.html#InteractiveShell">source&nbsp;code</a></span></p>
<p>Gives the user a custom prompt and the ability to type built in 
  commands to the interactive console. This class represents the core of 
  the console program, and must contain one or more <a 
  href="console.interactive.InteractiveCommand-class.html" 
  class="link">InteractiveCommand</a>s to provide functionality to the 
  user.</p>

<!-- ==================== NESTED CLASSES ==================== -->
<a name="section-NestedClasses"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Nested Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-NestedClasses"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="console.interactive.InteractiveCommand-class.html" 
      class="link">InteractiveCommand</a></span>
    </td><td class="summary">
        <a href="console.interactive.InteractiveShell._HelpCommand-class.html" class="summary-name" onclick="show_private();">_HelpCommand</a><br />
      Prints a list of available commands and their descriptions, or the 
      help text of a specific command
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="console.interactive.InteractiveCommand-class.html" 
      class="link">InteractiveCommand</a></span>
    </td><td class="summary">
        <a href="console.interactive.InteractiveShell._ExitCommand-class.html" class="summary-name" onclick="show_private();">_ExitCommand</a><br />
      Exits the interactive shell
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="__init__"></a><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">banner</span>=<span class="summary-sig-default">&quot;Welcome to Interactive Shell&quot;</span>,
        <span class="summary-sig-arg">prompt</span>=<span class="summary-sig-default">&quot; &gt;&gt;&gt; &quot;</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="console.interactive-pysrc.html#InteractiveShell.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>None</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="console.interactive.InteractiveShell-class.html#add_command" class="summary-sig-name">add_command</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">command</span>)</span><br />
      Adds a command to the interactive shell.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="console.interactive-pysrc.html#InteractiveShell.add_command">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>None</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="console.interactive.InteractiveShell-class.html#handle_input" class="summary-sig-name">handle_input</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">input</span>)</span><br />
      Worker task of the <a 
      href="console.interactive.InteractiveShell-class.html" 
      class="link">InteractiveShell</a> - takes the user input and parses 
      it for commands, options, and arguments, calls the command with its 
      correct arguments.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="console.interactive-pysrc.html#InteractiveShell.handle_input">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>None</code></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="console.interactive.InteractiveShell-class.html#run" class="summary-sig-name">run</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Starts up the <a 
      href="console.interactive.InteractiveShell-class.html" 
      class="link">InteractiveShell</a> with the correct command prompt, 
      completer, and banner; then listens for commands from the user and 
      executes them when it receives them.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="console.interactive-pysrc.html#InteractiveShell.run">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceVariables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>str</code></span>
    </td><td class="summary">
        <a name="banner"></a><span class="summary-name">banner</span><br />
      The message to be displayed at the top of the shell, right after the 
      program starts
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>dict</code></span>
    </td><td class="summary">
        <a name="commands"></a><span class="summary-name">commands</span><br />
      A dictionary of available commands, where the key is the command name
      and the value is the command object
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><code>str</code></span>
    </td><td class="summary">
        <a name="prompt"></a><span class="summary-name">prompt</span><br />
      A string that is displayed to the user while awaiting commands
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="add_command"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_command</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">command</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="console.interactive-pysrc.html#InteractiveShell.add_command">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a command to the interactive shell. This should be called before 
  <a href="console.interactive.InteractiveShell-class.html#run" 
  class="link">InteractiveShell.run</a> in order to give the user some 
  useful commands!</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>command</code></strong> (<a href="console.interactive.InteractiveCommand-class.html" 
          class="link">InteractiveCommand</a>) - A command to be added to the interactive shell.</li>
    </ul></dd>
    <dt>Returns: <code>None</code></dt>
        <dd>Returns nothing, modifies the <a 
          href="console.interactive.InteractiveShell-class.html" 
          class="link">InteractiveShell</a> in place</dd>
  </dl>
</td></tr></table>
</div>
<a name="handle_input"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">handle_input</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">input</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="console.interactive-pysrc.html#InteractiveShell.handle_input">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Worker task of the <a 
  href="console.interactive.InteractiveShell-class.html" 
  class="link">InteractiveShell</a> - takes the user input and parses it 
  for commands, options, and arguments, calls the command with its correct 
  arguments.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>input</code></strong> (<code>str</code>) - The raw string input from the prompt line.</li>
    </ul></dd>
    <dt>Returns: <code>None</code></dt>
        <dd>Returns nothing, operational method</dd>
  </dl>
<div class="fields">      <p><strong>Note:</strong>
        This method is called by <a 
        href="console.interactive.InteractiveShell-class.html#run" 
        class="link">InteractiveShell.run</a> method
      </p>
</div></td></tr></table>
</div>
<a name="run"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">run</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="console.interactive-pysrc.html#InteractiveShell.run">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Starts up the <a 
  href="console.interactive.InteractiveShell-class.html" 
  class="link">InteractiveShell</a> with the correct command prompt, 
  completer, and banner; then listens for commands from the user and 
  executes them when it receives them.</p>
  <dl class="fields">
    <dt>Returns: <code>None</code></dt>
        <dd>Returns nothing, operational method</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="console-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/console/">console</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Tue Nov 30 11:33:30 2010
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
